Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement test helpers for constructing user device data #4476

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jan 8, 2025

Currently it's very hard to extend our test data because it has been generated manually with real users and devices. I'd like to change that so that the data is created more dynamically, so that it is easier to extend.

This PR introduces a builder type which can be used to help construct such test data, and rebuilds some of the existing test data using it. Unfortunately we're lacking some private keys, so I've had to replace a couple of keys.

The PR also introduces some snapshots, so we can keep an eye on how the data is changing.

Recommend reviewing commit-by-commit.

@richvdh richvdh force-pushed the rav/test_data_rework branch 5 times, most recently from e31eff1 to 25f7927 Compare January 8, 2025 11:42
Comment on lines +262 to +263
/// Current user's private user-signing key, as an [`Ed25519SecretKey`].
pub fn me_private_user_signing_key() -> Ed25519SecretKey {
Ed25519SecretKey::from_base64(Self::USER_SIGNING_KEY_PRIVATE_EXPORT).unwrap()
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we end up using this in a few places in a later commit, hence pulling it out to a separate function

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.05%. Comparing base (c503583) to head (1cce2f3).
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4476   +/-   ##
=======================================
  Coverage   85.04%   85.05%           
=======================================
  Files         283      283           
  Lines       31749    31749           
=======================================
+ Hits        27002    27003    +1     
+ Misses       4747     4746    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richvdh richvdh force-pushed the rav/test_data_rework branch from a50bd6d to 88b101c Compare January 8, 2025 14:11
Our test helper won't do this, and it's redundant
... and use it for some simple data
Regenerate Dan's data with new cross-signing and device keys, for which I know
the private keys.

The signatures are manually calculated for now; this will be improved in a
later commit.
@richvdh richvdh force-pushed the rav/test_data_rework branch from 88b101c to 1cce2f3 Compare January 8, 2025 14:14
@richvdh richvdh marked this pull request as ready for review January 8, 2025 14:24
@richvdh richvdh requested a review from a team as a code owner January 8, 2025 14:24
@richvdh richvdh requested review from Hywan and removed request for a team January 8, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants